      SUBROUTINE QUIKVIS2E(IERR,IEND)
      IMPLICIT REAL*8 (A-H,O-Z)
C
C THIS ROUTINE IS PART OF THE QUIKVIS PROGRAM.  IT IS THE ROUTINE BY
C WHICH THE USER SETS THE ORBIT'S RAAN RANGE.  THE RANGE IS SPECIFIED
C DIRECTLY OR BY SPECIFYING THE RAAN'S RANGE OF MEAN SOLAR TIMES. FIRST,
C THE USER SETS THE OPTION, THEN THE VALUES INVOLVED.
C
C VARIABLE DIM TYPE I/O DESCRIPTION
C -------- --- ---- --- -----------
C
C IERR      1   I*4  O  ERROR RETURN FLAG
C                       =0, NO ERRORS.
C                       = OTHERWISE, ERROR PRESENT.
C
C IEND      1   I*4  O  END-FILE FLAG
C                       =0, NO END-FILE ENCOUNTERED DURING USER INPUT.
C                       =1, END-FILE ENCOUNTERED.
C
C***********************************************************************
C
C BY C PETRUZZO/GFSC/742.   2/86.
C       MODIFIED....
C
C***********************************************************************
C
      INCLUDE 'QUIKVIS.INC'
C
      LOGICAL OK
      CHARACTER*12 ERRMSG(2)/ 'REPROMPTING.', 'STOPPING.' /
C
      IERR = 0
      IEND = 1  ! WILL BE RESET TO ZERO IF READ IS DONE OK
C
C
      CALL QUIKVIS999(-1,R8DATA,I4DATA,L4DATA)
C
      WRITE(LUPROMPT,6756) '4'
 6756 FORMAT(//,
     *   ' ***************** USER GUIDE TABLE ',A,' *****************'/)
C
C
C PROMPT FOR THE OPTION ON HOW TO SPECIFY THE NODE RANGE
C
      OK = .FALSE.
      NODESAV = NODEOPT
      DO WHILE (.NOT.OK)
        NODEOPT = NODESAV
        WRITE(LUPROMPT,7801) NODEOPT
 7801   FORMAT(//,
     *    ' SPECIFY THE METHOD OF ASSIGNING ORBIT RAAN''S.'//,
     *    '    1= NODE RANGE SPECIFIED DIRECTLY.'/,
     *    '    2= MEAN SOLAR TIME RANGE IS SPECIFIED. RAAN COMPUTED.'//,
     *    '    DEFAULT = ',I2//,
     *    ' ENTER > ',$)
        READ(LUINPUT,*,END=9999) NODEOPT
C
        OK = NODEOPT.EQ.1 .OR. NODEOPT.EQ.2
        IF(.NOT.OK) THEN
          INDEXERR = 1
          IF(.NOT.INTERACTIVE) INDEXERR = 2
          WRITE(LUPROMPT,7800)
     *       'INVALID RAAN SPECIFICATION OPTION',ERRMSG(INDEXERR)
          IF(.NOT.INTERACTIVE) THEN
            IERR = 1
            GO TO 9999
            END IF
          END IF
        END DO
C
      NEEDTIME = NEEDTIME .OR. NODEOPT.EQ.2
C
      CALL QUIKVIS999(1,R8DATA,I4DATA,L4DATA)
C
C
C SET THE PARMETERS DEFINING THE NODE RANGE.
C
      IF(NODEOPT.EQ.1) THEN
C      SPECIFY THE NODE RANGE DIRECTLY
        CALL QUIKVIS2E1(IERR,IEND)
        CALL QUIKVIS999(-1,R8DATA,I4DATA,L4DATA)
C
      ELSE
C      SPECIFY RANGE OF MEAN SOLAR TIMES
        CALL QUIKVIS2E2(IERR,IEND)
        CALL QUIKVIS999(-1,R8DATA,I4DATA,L4DATA)
C
        END IF
C
C
 9999 CONTINUE
C
C WRAP UP. STORE DATA IN QUIKVIS999 ARRAYS FOR RETRIEVAL ELSEWHERE.
C
      CALL QUIKVIS999(1,R8DATA,I4DATA,L4DATA)
C
      RETURN
 7800 FORMAT(/,'   >>> USER INPUT ERROR. ',A,'.  ',A/)
      END
